<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>httxlib.httxauth</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="httxlib-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/httxlib/">HttxLib</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="httxlib-module.html">Package&nbsp;httxlib</a> ::
        Module&nbsp;httxauth
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="httxlib.httxauth-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module httxauth</h1><p class="nomargin-top"><span class="codelink"><a href="httxlib.httxauth-pysrc.html">source&nbsp;code</a></span></p>
<p>Authentication functions to answer to Basic and Digest HTTP 
  authentication challenges</p>

<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">tuple (str, str|None)</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="httxlib.httxauth-module.html#authbasic" class="summary-sig-name">authbasic</a>(<span class="summary-sig-arg">username</span>,
        <span class="summary-sig-arg">password</span>,
        <span class="summary-sig-arg">authchallenge</span>)</span><br />
      Given a username and a password return an HTTP Basic Authentication 
      challenge.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="httxlib.httxauth-pysrc.html#authbasic">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">tuple (str|None, str|None)</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="httxlib.httxauth-module.html#authdigest" class="summary-sig-name">authdigest</a>(<span class="summary-sig-arg">username</span>,
        <span class="summary-sig-arg">password</span>,
        <span class="summary-sig-arg">challenge</span>,
        <span class="summary-sig-arg">request</span>,
        <span class="summary-sig-arg">nonce_count</span>)</span><br />
      Given a username, password, a list of challenge fields, a request a 
      sequence number (nonce_count) return a Diget Auth challenge answer</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="httxlib.httxauth-pysrc.html#authdigest">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'httxlib'"><code class="variable-quote">'</code><code class="variable-string">httxlib</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="authbasic"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">authbasic</span>(<span class="sig-arg">username</span>,
        <span class="sig-arg">password</span>,
        <span class="sig-arg">authchallenge</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="httxlib.httxauth-pysrc.html#authbasic">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Given a username and a password return an HTTP Basic Authentication 
  challenge.</p>
  <p>The authchallenge parameter is just for harmony with authdigest and 
  for potentially defining a plug-in interface for other 
  authentications</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>username</code></strong> (str) - The username to reply to the challenge</li>
        <li><strong class="pname"><code>password</code></strong> (str) - The password to reply to the challenge</li>
    </ul></dd>
    <dt>Returns: tuple (str, str|None)</dt>
        <dd>A tuple containing a base64 encoded challenge and a string with a
          cache-able challenge for future responses The second value can be
          None</dd>
  </dl>
</td></tr></table>
</div>
<a name="authdigest"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">authdigest</span>(<span class="sig-arg">username</span>,
        <span class="sig-arg">password</span>,
        <span class="sig-arg">challenge</span>,
        <span class="sig-arg">request</span>,
        <span class="sig-arg">nonce_count</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="httxlib.httxauth-pysrc.html#authdigest">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Given a username, password, a list of challenge fields, a request a 
  sequence number (nonce_count) return a Diget Auth challenge answer</p>
  <p>If username is None, then challenge will contain a username key with 
  the username and the password parameter will be the cached value of the 
  HA1 (see the function below) to be used</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>username</code></strong> (str|None) - The username to reply to the challenge or None to indicate that 
          the password contains a HA1 cache</li>
        <li><strong class="pname"><code>password</code></strong> (str) - The password to reply to the challenge or a HA1 cache</li>
        <li><strong class="pname"><code>challenge</code></strong> (dict) - Dictionary with the parameters in the challenge</li>
        <li><strong class="pname"><code>request</code></strong> (<a href="httxlib.httxrequest.HttxRequest-class.html" 
          class="link">HttxRequest</a>) - The request that has generated the auth challenge</li>
        <li><strong class="pname"><code>nonce_count</code></strong> (int) - Sequence value if this not the first time such a request has been
          seen. Used by Digest auth to prevent replay attacks</li>
    </ul></dd>
    <dt>Returns: tuple (str|None, str|None)</dt>
        <dd>A tuple containing a digest answer  and a string with a 
          cache-able challenge for future responses Both values can be None
          if a specific non-supported variant of the Digest Auth is used</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="httxlib-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/httxlib/">HttxLib</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sat Aug 13 14:56:41 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
